//index.js
const news= require('../../config').news;
const getCurrentPagesApi = require('../../utils/common').getCurrentPagesApi;
const host = require('../../config').host
//获取应用实例
const app = getApp()


Page({
  data: {
    news: [],
    currentNewsId: 1,
    scrollHeight: 0,
    showModal:true,
    hidden:true,
    hiddens:false,
  },
  //事件处理函数
  bindViewTap: function() {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
  news_detail: function(e) {
    wx.navigateTo({
      url: `./news_detail?id=${e.currentTarget.dataset.id}`
    })
  },
  onShareAppMessage: function (res) {
    if (res.from === 'menu') {
      return {
        title: 'MARKET INTERPRETED',
        path: getCurrentPagesApi()
      }
    }
    
  },
  onLoad: function () {
    
  },
  getUserInfo: function(e) {
    console.log(e)
    app.globalData.userInfo = e.detail.userInfo
    this.setData({
      userInfo: e.detail.userInfo,
      hasUserInfo: true
    })
  }
})
